package com.cpr.ams.util;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 状态码
 * @Author: GX Cui
 * @Date 9:55 下午 2021/4/6
 */
@AllArgsConstructor
@Getter
public enum StatusCode {

    /* 成功状态码 */
    SUCCESS(200, "操作成功"),


    /* 用户错误：20001-29999*/
    USER_NOT_LOGIN(20001, "用户未登录"),
    USER_LOGIN_ERROR(20002, "账号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(20003, "账号已被禁用"),
    USER_NOT_EXIST(20004, "用户不存在"),
    USER_HAS_EXISTED(20005, "用户已存在"),
    TOKEN_NOT_LEGAL(20006,"token不合法"),
    TEL_HAS_EXISTED(20007, "手机号已存在"),
    TEL_CODE_ERROR(20008,"手机验证码错误"),

    /*其余错误可自行添加*/
    /*角色错误*/
    ROLE_NOT_EXIST(30004, "角色不存在"),

    /*权限错误*/
    TOKEN_EXPIRED(40001, "token过期"),
    TOKEN_PARSING_EXCEPTION(40002, "token解析异常"),
    SIGNATURE_FAILED(40003, "签名失败"),
    PERMISSION_DENIED(40004, "权限不足"),
    PRIVILEGE_NOT_EXIST(40004, "权限不存在"),

    /*未知错误*/
    UNKNOWN_ERROR(11111,"未知错误");

    private Integer code;
    private String message;
}
